package com.recharge.job;

import com.recharge.bean.Switch;
import com.recharge.mapper.TradeNotifyMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * Created by qi.cao on 2016/5/16.
 */
@Service
public class GetOrderJob {

    @Autowired
    private GetOrderService getOrderService;

    @Autowired
    private Switch aSwitch;

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Scheduled(cron="${getOrderJobCron}")
    public void getOrderToRecharge(){
        if (aSwitch.isGetOrderSwitch()){
            getOrderService.getOrderToRecharge();
        }else{
            logger.info("取单处于关闭中！！！！");
        }
    }
}
